package com.example.consumerone.services;

import com.example.common.base.Result;
import com.example.common.model.UserFeedback;
import com.example.consumerone.hystrix.UserFeedbackServiceHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Service
@FeignClient(value = "provider", fallback = UserFeedbackServiceHystrix.class)
public interface UserFeedbackService {

  @PostMapping("/userFeedback/add")
  public Result<?> add(@RequestBody UserFeedback userFeedback);

  @PostMapping("/userFeedback/save")
  public Map<String,Object> saveFeedback(@RequestParam(value = "types") String types,
                                         @RequestParam(value = "content") String content,
                                         @RequestParam(value = "relation") String relation);
}
